import { http } from '@/util/axios/http';

const api = http.create();

/** 查询组织机构 */
const findOrg = (orgcode: string,flag: string) => {
  return api.get('/api/gk/findOrg.open',{
    params: {
      orgcode,
      flag,
    }
  });
}

/** 校验身份证 */
const permissionCheck = (idCard: string, orgcode: string) => {
  return api.get('/api/szOpen/permissionCheck',{
    params: {
      idCard,
      orgcode,
    }
  });
};

/** 查询收支列表 */
const findSzOpen = (orgcode :string, ny :string, sortType :string) => {
  return api.get('/api/szOpen/findSzgkbMx',{
    params: {
      orgcode,
      ny,
      sortType,
    }
  });
};

/** 查询公开事项 */
const getCwgkByLb = (lb: string, orgcode: string, ny: string, start: number, pagesize: number) => {
  return api.get('/api/szOpen/getCwgkByLb',{
    params: {
      lb,
      orgcode,
      ny,
      start,
      pagesize,
    }
  });
};

export const appApi = {
  findOrg,
  permissionCheck,
  findSzOpen,
  getCwgkByLb,
};
